<!DOCTYPE html>
<html lang="zh-cn">
<head>
<title>创建企业网络</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script src="${base}/public/plug/jquery/jquery.min.js"></script>
<link href="${base}/public/plug/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="${base}/public/plug/bootstrap/js/bootstrap.js" ></script>
<style type="text/css">
body {
    font-family: "微软雅黑", Helvetica, Arial, sans-serif;
}
.rl {
    background-color: #323A47;
}
.rl .header {
    margin: 20px 0;
    position: relative;
    height: 61px;
    line-height: 61px;
}
.rl .header .logo {
/*     background-image: url("https://www.ikcrm.com/assets/img/logo.png"); */
    width: 200px;
    height: 66px;
    display: inline-block;
    background-repeat: no-repeat;
    color: #FCF4F4;
    font-size: 24px;
    text-align:center;
    text-decoration: none;
    outline-style:none; 
    -moz-outline-style: none;
}

.rl .wrap {
    width: 600px;
    margin: 0 auto;
}
.rl .header {
    margin: 20px 200px;
    position: relative;
    height: 61px;
}
.rl .content {
    min-height: 350px;
    background-color: #fff;
    border-radius: 2px;
    margin-bottom: 25px;
}
.rl .content .title-applyPage {
    padding: 10px 24px;
    font-size: 24px;
}
.rl .content .title {
    color: #A5A5A5;
    text-align: left;
    background-color: #e4e4e4;
}
.rl .content .form {
    padding: 24px;
}
.text-grey {
    color: #949AA7;
}
.required-star {
    float: left;
    color: #c30;
    padding-right: 5px;
    top: 0;
    font-weight: 400;
    font-size: 13px;
}
</style>
</head>
<body class="rl   pace-done">

	<div class="wrap">
		<div class="header" style="top: auto; position: static;">
			<a class="logo" href="/"> EasyMis</a>

		</div>
		<div class="content">
			<div class="title title-applyPage">EasyMis 独立版-申请免费试用</div>
			<form class="text-grey form form-horizontal" id="registerUserForm"
				action="${base}/register/signUpConfirm.action"
				accept-charset="UTF-8" method="post" novalidate="novalidate">
				<input name="utf8" value="✓" type="hidden"> <input
					name="authenticityToken"
					value="${authenticityToken}"
					type="hidden"> <input name="cross_site_entity_id"
					id="cross_site_entity_id" type="hidden"> <input
					name="utm_source" id="utm_source" type="hidden">

				<div class="form-group">
					<label class="control-label col-sm-2" title="手机号"> <span
						class="required-star">*</span>手机号
					</label>
					<div class="col-sm-9">
						<input autofocus="autofocus" class="form-control"
							placeholder="请输入手机号" value="" name="mobile" id="mobile"
							 maxlength="11" type="text">
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-2" title="图形识别码"> <span
						class="required-star">*</span>识别码
					</label>
					<div class="input-group col-sm-9">
						<div class="captcha-ip col-sm-5 validate-code captcha-code">
							<input name="userCaptcha" id="userCaptcha" class="form-control"
								placeholder="请输入4位识别码" autocorrect="off" autocapitalize="off"
								pattern="[a-zA-Z]*" maxlength="4" autocomplete="off" type="text">
						</div>
						<div class="rucaptcha-image-box">
							<img id="j_userCaptchaImages" alt="图形识别码" class="col-sm-4"
								src="validateCodeServlet.images"
								data-src="https://www.ikcrm.com/rucaptcha/" width="230"
								height="34">
						</div>
						<div class="refresh captcha-refresh col-sm-3">
							看不清？<a class="a-primary" href="javascript:reloadVify();">换一张</a>
						</div>
					</div>

					<div class="clearfix"></div>
				</div>


				<div class="form-group">
					<label class="control-label col-sm-2" title="获取验证码"> </label>
					<div class="col-sm-9">
						<a href="javascript:;" class="btn btn-primary J-getcode"
							id="fetch_confirm_code" data-count="60">获取验证码</a> 
					</div>
				</div>

				<div class="form-group">
					<label class="control-label col-sm-2" title="短信验证码"> <span
						class="required-star">*</span>验证码
					</label>
					<div class="col-sm-9">
						<input class="form-control" placeholder="请输入短信验证码"
							name="shortMessage" id="shortMessage"  maxlength="6" type="text">
					</div>
				</div>

				<div class="form-group center-block">
					<div class="col-md-5 col-md-offset-4">
						<input name="commit" value="下一步"
							class="btn btn-lg btn-primary btn-block" id="next_step_btn"
							data-disable-with="提交中 ..." type="submit">
					</div>
				</div>
			</form>
		</div>


		<div class="footer">沪ICP备13009389号-1</div>

	</div>

<link
	href="${base}/public/plug/bootstrapvalidator/css/bootstrapValidator.css"
	rel="stylesheet">
<script
	src="${base}/public/plug/bootstrapvalidator/js/bootstrapValidator.js"
	data-name="formValidation"></script>
<script type="text/javascript">
$(function(){
$('#registerUserForm').bootstrapValidator({
	'locale' : 'zh_CN',
	'framework' : 'bootstrap',
	'excluded' : ':disabled',
	'autoFocus' : !![],
	'fields' : {
		'mobile' : {
			'validators' : {
				'notEmpty' : {
					'message' : '手机号不能为空'
				}, 
                'regexp': {  
                    'regexp': /^1[3|5|8|7]{1}[0-9]{9}$/,  
                    'message': '请输入正确的手机号码'  
                },
				'callback': {  
                	'message': '此手机号已注册，请换一个手机号注册',  
	                'callback': function(value, validator) {
	                	var flag = true;
	                	if (value){
		                	$.ajax({
		        				type : "POST",
		        				url : '${base}/register/queryMobile.action',
								async:false,
		        				data: 'mobile='+value,
		        				success : function(msg) {
		        					flag = msg;
		        				},
		        				error : function(err) {
		        				}
		        			});
	                	}
	                	return flag;
	                } 
	            }
			}
		},
		'userCaptcha' : {
			'validators' : {
				'notEmpty' : {
					'message' : '识别码不能为空'
				},
				'callback': {  
                	'message': '请输入正确的识别码',  
	                'callback': function(value, validator) {
	                	var flag = true;
	                	if (value){
		                	$.ajax({
		        				type : "POST",
		        				url : '${base}/register/checkUserCaptcha.action',
								async:false,
		        				data: 'userCaptcha='+value,
		        				success : function(msg) {
		        					flag = msg;
		        				},
		        				error : function(err) {
		        					
		        				}
		        			});
	                	}
	                	return flag;
	                } 
	            }
			}
		},
		'shortMessage' : {
			'validators' : {
				'notEmpty' : {
					'message' : '请输入接收的短信验证码'
				},
				'callback': {  
                	'message': '请输入正确的短信验证码！',  
	                'callback': function(value, validator) {
	                	var flag = true;
		                if (value){
		                	$.ajax({
		        				type : "POST",
		        				url : '${base}/register/checkShortMessage.action',
								async:false,
		        				data: 'shortMessage='+value,
		        				success : function(msg) {
		        					flag = msg;
		        				},
		        				error : function(err) {
		        					//$.ligerDialog.error('服务器繁忙，请稍后再试');
		        				}
		        			});
	                	}
	                	return flag;
	                } 
	            }
			}
		}

	}
});

});

function reloadVify() {
	var imgTag = $('#j_userCaptchaImages'),
	_src = imgTag.prop('src');
	imgTag.prop('src', _src + '?tm=' + Math.random());
}
	$("#next_step_btn").click(function(){
//	c.bootstrapValidator('validate');
	if($("#registerUserForm").data('bootstrapValidator').isValid()){
	///	$("#registerUserForm")submit();		
	}
	});

	$("#fetch_confirm_code").click(function(){
	$.ajax({
		type : "POST",
		url : '${base}/register/buildValidateCode.action',
			data : {
				mobile : $("#mobile").val(),
				userCaptcha : $("#userCaptcha").val()
			},
			success : function(msg) {
				;
			},
			error : function(err) {
			}
		});
	});

</script>
</body>
</html>
